package com.vken.blog.action;

import com.opensymphony.xwork2.ActionSupport;
import com.vken.blog.model.Blog;
import com.vken.blog.service.BlogManager;
import com.vken.blog.util.Const;

public class BlogAction extends ActionSupport {
	private static final long serialVersionUID = 1461681378447129885L;
	private Blog blog;
	private BlogManager blogManager;

	public Blog getBlog() {
		return blog;
	}

	public String load() {
		blog = blogManager.get(Const.BLOG_ID);
		return SUCCESS;
	}

	public void setBlog(Blog blog) {
		this.blog = blog;
	}

	public void setBlogManager(BlogManager blogManager) {
		this.blogManager = blogManager;
	}

	public String update() {
		blogManager.update(blog);
		return SUCCESS;
	}
}
